package cn.bonoon.kernel.query;


/**
 * <pre>
 * 支持进行分页查询
 * 
 * 子类可以用{@link cn.bonoon.kernel.web.annotations.condition.ConditionStyle ConditionStyle}进行注解
 * </pre>
 * @author jackson
 * @see SearchCondition
 */
public class PageCondition extends SearchCondition {

	/**
	 * 
	 */
	private static final long serialVersionUID = -620700340426313489L;


	public PageCondition() {
	}

	public PageCondition(int page, int rows) {
		this.page = page;
		this.rows = rows;
	}
	
	protected PageCondition(PageCondition copy){
		super(copy);
		page = copy.page;
		rows = copy.rows;
	}

	private int page;
	private int rows;


	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public int getRows() {
		return rows;
	}

	public void setRows(int rows) {
		this.rows = rows;
	}

	public Pageable toPage() {
		return new PageRequest(page, rows);
	}
}
